using System;
using System.Collections.Generic;
using System.Text;
using JobShopModel.Model.FactoryLvl;
using JobShopModel.Model;
using JobShopModel.Model.Transport;

namespace JobShopModel.Events
{
    /// <summary>
    /// Abstract Class:
    /// Represent all Events involving the transporter
    /// </summary>
    abstract public class TransportEvent:IEvent
    {
        private Time sTime;

        /// <summary>
        /// Property:
        /// Time the event must be excuted
        /// Read Only, must be set by the constructor of the implementation,
        /// Will be used to store the Event in the <seealso cref="EventQueue"/>
        /// </summary>
        public Time ExecTime
        {
            get { return this.sTime; }
        }

        /// <summary>
        /// Property:
        /// Return the transporter of the factory
        /// </summary>
        /// <seealso cref="Factory"/>
        protected Transporter Transporter
        {
            get { return Factory.getInstance().Transporter; }
        }

        /// <summary>
        /// Default COnstructor
        /// </summary>
        /// <param name="stime">Time the event should be excecuted</param>
        public TransportEvent(Time stime)
        {
            this.sTime = stime;
        }

        /// <summary>
        /// Polymorphic method
        /// It will be instanced by all Events and excecuted by the eventloop
        /// </summary>
        public abstract void Process();

        #region IEvent Membres


        public JobShopModel.Model.Logger Logger
        {
            get { return Logger.GetLogger(); }
        }

        #endregion
    
#region IComparable<IEvent> Members

public int  CompareTo(IEvent other)
{
    return this.ExecTime.CompareTo(other.ExecTime);
}

#endregion
}
}
